package zxq.rollcall.course.controller.action;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import zxq.rollcall.course.entity.dto.ResultDTO;
import zxq.rollcall.course.entity.dto.db.CourseSignDTO;
import zxq.rollcall.course.entity.dto.db.StudentInfoDTO;
import zxq.rollcall.course.entity.dto.db.StudentSignDTO;
import zxq.rollcall.course.entity.dto.db.TeacherSignDTO;
import zxq.rollcall.course.entity.dto.set.CourseDTO;
import zxq.rollcall.course.entity.query.CourseQuery;
import zxq.rollcall.course.entity.query.PageQuery;

import java.util.List;

public interface ICourseController {



    @PostMapping(value = "/save",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "存储课程信息",notes = "存储课程信息")
    @ResponseBody
    ResultDTO<Boolean> save(CourseQuery courseQuery);


    @PostMapping(value = "/update",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "修改课程信息",notes = "修改课程信息")
    @ResponseBody
    ResultDTO<Boolean> update(Integer id,CourseQuery courseQuery);


    @PostMapping(value = "/delete",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "删除课程信息",notes = "删除课程信息")
    @ResponseBody
    ResultDTO<Boolean> delete(Integer id);


    @GetMapping(value = "/query",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查询课程信息",notes = "查询课程信息")
    @ResponseBody
    ResultDTO<List<CourseDTO>> query(PageQuery pageQuery);

    @PostMapping(value = "/query/student/course",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "学生查询课程信息")
    @ResponseBody
    ResultDTO<List<CourseDTO>> studentQuery(Integer stuId,Boolean isAll);

    @PostMapping(value = "/query/teacher/course",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "老师查询课程信息")
    @ResponseBody
    ResultDTO<List<CourseDTO>> teacherQuery(Integer teacherId,Boolean isAll);

    @GetMapping(value = "/query/course/{courseId}",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查询课程课程信息")
    @ResponseBody
    ResultDTO<CourseDTO> courseQuery(@PathVariable(value = "courseId")Integer courseId);

    @GetMapping(value = "/query/course/sign/{courseId}",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查询课程签到信息")
    @ResponseBody
    ResultDTO<List<CourseSignDTO>> courseSignQuery(@PathVariable(value = "courseId")Integer courseId);

    /**
     * 开启签到
     * @param courseId 课程id
     * @param sign 是否签到 true开始签到,false结束签到
     * @return
     */
    @PostMapping(value = "/insert/teacher/sign",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "老师开始签到",notes ="老师开始签到")
    @ResponseBody
    ResultDTO<Boolean> teacherSign(Integer courseId,Boolean sign);


    /**
     * 学生签到
     * @param courseId 课程id
     * @param studentId 学生id
     * @return
     */
    @PostMapping(value = "/insert/student/sign",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "学生开始签到")
    @ResponseBody
    ResultDTO<Boolean> studentSign(Integer courseId, Integer studentId);


    /**
     * 查看课程详细信息，数学课每次签到得情况，多少人签到，多少人未签到
     * @param courseId 课程信息
     * @return
     */
    @GetMapping(value = "/query/multiple/sign/course/{courseId}",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "统计每次签到得情况")
    @ResponseBody
    ResultDTO<List<CourseSignDTO>> queryCourseSignDetail(@PathVariable("courseId") Integer courseId);

    /**
     * 查看最新签到得课程信息,最近一次课程签到得情况
     * @param courseId 课程id
     * @return
     */
    @GetMapping(value = "/query/single/sign/course/{courseId}",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查看最新签到得情况")
    @ResponseBody
    ResultDTO<CourseSignDTO> queryNewCourse(@PathVariable("courseId") Integer courseId);

    /**
     * 查看某一课程下得签到情况
     * @param courseId 课程id
     * @return
     */
    @GetMapping(value = "/query/multiple/sign/course/student/{courseId}",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "某一课程下得，所有学生签到统计情况")
    @ResponseBody
    ResultDTO<List<StudentSignDTO>> queryGatherStudentStatistics(@PathVariable("courseId")Integer courseId);

    /**
     * 查看某一课程下，某一学生得签到情况
     * @return
     */
    @GetMapping(value = "/query/single/sign/course/student",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "某一课程下，某一课程签到得统计情况")
    @ResponseBody
    ResultDTO<StudentSignDTO> querySingleStudentStatistics(Integer courseId,Integer studentId);

    /**
     * 查看学生得签到记录,多个课程
     * @param studentId 学生id
     * @return
     */
    @PostMapping(value = "/query/sign/course/student/record/multiple",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查看单个学生签到得情况，多个课程得签到记录")
    @ResponseBody
    ResultDTO<List<StudentInfoDTO>> queryStudentSignDetail(Integer studentId,PageQuery pageQuery);


    /**
     * 查看学生签到记录，单个课程
     * @param studentId 学生id
     * @param courseId 课程id
     * @param pageQuery 页码
     * @return
     */
    @GetMapping(value = "/query/sign/course/student/record/single",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查看单个学生签到得情况，单个课程得签到记录")
    @ResponseBody
    ResultDTO<List<StudentInfoDTO>> queryStudentCourseSignDetail(Integer studentId,Integer courseId,PageQuery pageQuery);




    @GetMapping(value = "/query/sign/course/teacher/sign/record",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查看老师每次签到的记录")
    @ResponseBody
    ResultDTO<List<TeacherSignDTO>> queryTeacherSignDetail(Integer teacherSignId);








}
